package com.lee.study.ws.websocket;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.TextWebSocketHandler;

/**
 * Created by alex on 15-1-13.
 */
public class MyHanler extends TextWebSocketHandler {

    public static final Logger log = LoggerFactory.getLogger(MyHanler.class);
    
    protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
        log.debug(String.format("session id %s",session.getId()));
        log.debug(String.format("session locationAddress %s",session.getLocalAddress()));
        log.debug(String.format("session remoteAddress %s",session.getRemoteAddress()));
        
        log.debug(String.format("message %s",message.toString()));
    }
    
    
    
}
